<div style="height: 100%;" [busyIf]="primengTableHelper.isLoading">
    <div class="form-group form-md-line-input form-md-floating-label no-hint">
        <label>投产数量: </label>
        {{ pipe.amountPlanned }}
    </div>

    <div class="form-group" *ngIf="!batch?.deliveryRecord">
        <label>选择交接车间: </label>
        <select
            name="departments"
            class="form-control"
            [(ngModel)]="departmentValue"
            title="选择交接车间"
        >
            <option *ngFor="let item of departments" [value]="item.value">{{
                item.name
            }}</option>
        </select>
    </div>

    <div
        *ngIf="!batch?.deliveryRecord"
        class="form-group form-md-line-input form-md-floating-label no-hint"
    >
        <label>录入合格证: </label>
        <input
            class="form-control"
            name="certificate"
            type="text"
            [ngClass]="{ edited: batch.certificateId }"
            [(ngModel)]="batch.certificateId"
            required
        />
    </div>

    <div
        *ngIf="!batch?.deliveryRecord"
        class="form-group form-md-line-input form-md-floating-label no-hint"
    >
        <label>录入合格证数量: </label>
        <input
            class="form-control"
            name="certificateQuantity"
            type="number"
            min="1"
            [ngClass]="{ edited: batch.certificateQuantity }"
            [(ngModel)]="batch.certificateQuantity"
            required
        />
    </div>

    <div
        *ngIf="batch?.deliveryRecord"
        class="form-group form-md-line-input form-md-floating-label no-hint"
    >
        <label>交接信息: </label>
        <h5>
            接收车间：{{ batch.deliveryRecord.destinationId }} ， 交接数量：{{
                batch.deliveryRecord.deliveredQuantity
            }}
        </h5>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <h6 *ngIf="batch?.deliveryRecord">
                <label style="margin: 10px 0">备注: </label>
                <input style="width:98%;height:40px;"
                class="form-control"
                name="remark"
                type="text"
                [(ngModel)]="batch.deliveryRecord.remark"
                />
            </h6>

            <p-dropdown
            *ngIf="batch?.deliveryRecord"
            [options]="teamGroups"
            name="teamGroups"
            [(ngModel)]="teamGroupName"
            placeholder="选择打印机"
            optionLabel="displayText"
            [style]="{ 'width': '190px' }"
            ></p-dropdown>
            <button
                *ngIf="batch?.deliveryRecord"
                type="button"
                class="btn btn-sm btn-success float-right"
                (click)="print()"
                [buttonBusy]="saving"
                [busyText]="'打印中...'"
            >
                <i class="fa fa-check-circle"></i> <span>打印交接单</span>
            </button>
            <button
                *ngIf="!batch?.deliveryRecord"
                [disabled]="
                    !batch.certificateId ||
                    !batch.certificateQuantity ||
                    !departmentValue
                "
                type="button"
                class="btn btn-sm btn-success float-right"
                (click)="save()"
                [buttonBusy]="saving"
                [busyText]="'生成交接单中...'"
            >
                <i class="fa fa-check-circle"></i> <span>生成交接单</span>
            </button>
        </div>
    </div>
</div>
